<link rel="stylesheet" type="text/css" href="{$smarty.const.URL_FULL}modules/abbannermodule/css/abbannermodule.css" />
{if $in_admin_mode == 1}
<div class="abbannermodule" style="width: {$config->mwidth}px; height: {$config->mheight}px;">
	<ul class="default">
		<li class="manage"><a class="tip" title="Quản lý tài nguyên" href="{link action=list module=abbannermodule}">Quản lý tài nguyên</a></li>
		<li class="configure"><a class="tip" title="Cấu hình hiển thị module này" href="{link action=configure _common=1}">Cấu hình module</a></li>
	</ul>
</div>
{elseif $item != 0}
	{if $config->show_type == 0}
		{* For text *}
		<div class="abbannermodule" style="width: {$config->mwidth}px; height: {$config->mheight}px;">
			{$item->text_value}
		</div>
	{elseif $config->show_type == 1}
	{* For img *}
		<link rel="stylesheet" type="text/css" href="{$smarty.const.URL_FULL}/modules/abbannermodule/nivoslider/nivo.css" />
		<script src="{$smarty.const.URL_FULL}/modules/abbannermodule/nivoslider/jquery.nivo.slider.pack.js" type="text/javascript"></script>
		
		<div id="homePromo" class="hasChrome">
			<div class="chrome "><div class="tl"></div><div class="tr"></div><div class="bl"></div><div class="br"></div></div>
			<div class="chromeContent">
				<div class="abbannermodule" style="width: {$config->mwidth}px; height: {$config->mheight}px;">
					<div id="slider" class="nivoSlider">
				{foreach from=$item item=link}
				<a href="{$link->img_linkurl}" title="{$link->title}" >  
					<img src="{$smarty.const.URL_FULL}/phpThumb.php?src={$smarty.const.PATH_RELATIVE}{$link->img_path}&w={$config->mwidth}" width="{$config->mwidth}px" height="{$config->mheight}px" title="{$link->title}">
				</a>
				{/foreach}
					</div>
				</div>
			</div>
		</div>
		{literal}
			<script type="text/javascript">
				jQuery(window).load(function() {
					jQuery('#slider').nivoSlider({
						animSpeed: 1500,
						pauseTime: 8000,
						directionNavHide: false,
						controlNav: false,
						captionOpacity: 0
					});
					
					jQuery(".nivo-directionNav a").hover(function(){
						 jQuery(this).fadeTo(900, 1);
					}, function(){
						jQuery(this).fadeTo(900, 0.4);
					});
				});
			</script>
			<style>
				#slider a img, #slider, #slider-wrapper{
					width: {/literal}{$config->mwidth}{literal}px;
					height: {/literal}{$config->mheight}{literal}px;
				}
			</style>
		{/literal}
	{elseif $config->show_type == 2}
		{* For flash *}
		<a href="{$item->flash_linkurl}">
		<embed height="{$config->mheight}" width="{$config->mwidth}" allowscriptaccess="always" wmode="transparent" loop="true" play="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"  src="{$item->flash_path}">
		</a>
	{/if}
{/if}